////////////////////////////////////////////////////////////////////////////////////////////////////
/// @file   CollabRCBot\Diff.h
///
/// @brief  Defines the CollabRC::Bot::Diff interface
////////////////////////////////////////////////////////////////////////////////////////////////////

#pragma once
#include "DiffLine.h"
#include "WordSet.h"

namespace CollabRC
{
    namespace Bot
    {
        /**
         * @brief Abstract representation of a difference between two
         * revisions of an article.
         * 
         * A Diff is a collection of DiffLine objects which represent
         * line changes within an article. The set of line changes represent
         * the entire change.
         * @version $Id$
         * @author Matthew P. Del Buono
         */
        class Diff
        {
        public:
            /** @brief Destroys this Diff object and all associated resources */
            inline virtual ~Diff(void) { }

            /**
             * @brief Gets the number of changed lines associated with this Diff object
             * 
             * A changed line is a line that is missing from the prior revision,
             * was added to the new revision, or both. 
             * @return the number of changed lines associated with this Diff object
             */
            virtual unsigned int GetNumLines() const = 0;

            /**
             * @brief Gets the changed line specified by the given index
             * @return the changed line specified by the given zero-based index
             * @throws IndexOutOfRangeException if the specified index is
             * greater than or equal to the number of lines specified by
             * GetNumLines().
             */
            virtual const DiffLine& GetLine(unsigned int n) const = 0;

            /**
             * @brief Gets the set of removed words across all changed lines.
             * 
             * The set of words are combined from all removed and changed lines to promote
             * the ability to check individual word occurrences.
             * @return the set of words which were removed by this change
             */
            virtual const WordSet& GetRemovedWords() const = 0;

            /**
             * @brief Gets the set of added words across all changed lines.
             *
             * The set of words are combined from all added and changed lines
             * to promote the ability to check individual word occurrences.
             * @return the set of words which were added by this change
             */
            virtual const WordSet& GetAddedWords() const = 0;
        };
    }
}
